package pl.edu.agh.io.fx3.saver.model;

public class FileInfo {

	private int id;
	private String virtualPath;
	private String realPath;
	private String checksum;


	public FileInfo(int id, String virtualPath, String realPath, String checksum) {
		super();
		this.id = id;
		this.virtualPath = virtualPath;
		this.realPath = realPath;
		this.checksum = checksum;
	}
	
	public FileInfo(String virtualPath, String realPath, String checksum) {
		super();
		this.virtualPath = virtualPath;
		this.realPath = realPath;
		this.checksum = checksum;
	}

	public FileInfo() {}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getVirtualPath() {
		return virtualPath;
	}

	public void setVirtualPath(String virtualPath) {
		this.virtualPath = virtualPath;
	}

	public String getRealPath() {
		return realPath;
	}

	public void setRealPath(String realPath) {
		this.realPath = realPath;
	}

	public String getChecksum() {
		return checksum;
	}

	public void setChecksum(String checksum) {
		this.checksum = checksum;
	}

	@Override
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("Id = ").append(id).append(" - ");
		sb.append("VirtualPath = ").append(virtualPath).append(" - ");
		sb.append("RealPath = ").append(realPath).append(" - ");
		sb.append("Checksum = ").append(checksum);
		return sb.toString();
	}

	@Override
	public boolean equals(Object obj) {  
		FileInfo file = (FileInfo) obj;
		if (this.id != file.getId()){
			return false;
		}
		if (!this.virtualPath.equals(file.getVirtualPath())){
			return false;
		}
		if (!this.realPath.equals(file.getRealPath())){
			return false;
		}
		if (!this.checksum.equals(file.getChecksum())){
			return false;
		}
		return true;
	}
}